﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CanDoo.Data.Entity;
using CanDoo.Oil.Core.Models;

namespace CanDoo.Oil.Core.ModelConfigurations
{
    /// <summary>
    /// 实体类-数据表映射——其他入库单明细
    /// </summary>
    public class InStoreOtherDetailConfiguration : EntityConfigurationBase<InStoreOtherDetail>
    {
        /// <summary>
        /// 初始化一个<see cref="InStoreOtherDetailConfiguration"/>类型的新实例
        /// </summary>
        public InStoreOtherDetailConfiguration()
        {
             ToTable("store_InStoreOtherDetail");
             this.Property(p => p.InStoreOtherId).HasColumnName("InStoreOtherId");
             this.HasRequired(p => p.InStoreOther).WithMany(n=>n.InStoreOtherDetails).HasForeignKey(p => p.InStoreOtherId).WillCascadeOnDelete(false);

             this.Property(p => p.ProductId).HasColumnName("ProductId");
             this.HasRequired(p => p.Product).WithMany().HasForeignKey(p => p.ProductId).WillCascadeOnDelete(false);

        }
    }
}
